Skip to content

Use absolute paths in #line directives generated #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 24, 2015

Conversation

matthijskooijman
Copy link
Collaborator

Multiple .ino files in a sketch are concatenated together, adding #line
directives so error messages refer to the original filenames. However,
these directives used plain filenames, without a path. Since these
filenames end up in the debug info as-is, this complicates using a
debugger on the resulting .elf file. Using full pathnames fixes this.

The tests are updated to expect full paths as well. This uses the
text/template package to process the sketch file, allowing it access to
the full context. This is a bit overkill, but it is easy and might be
useful for more complex testcases later.

This fixes arduino/Arduino#3746.

Signed-off-by: Matthijs Kooijman [email protected]

Multiple .ino files in a sketch are concatenated together, adding #line
directives so error messages refer to the original filenames. However,
these directives used plain filenames, without a path. Since these
filenames end up in the debug info as-is, this complicates using a
debugger on the resulting .elf file. Using full pathnames fixes this.

The tests are updated to expect full paths as well. This uses the
text/template package to process the sketch file, allowing it access to
the full context. This is a bit overkill, but it is easy and might be
useful for more complex testcases later.

This fixes arduino/Arduino#3746.

Signed-off-by: Matthijs Kooijman <[email protected]>
ffissore added a commit that referenced this pull request Sep 24, 2015
Use absolute paths in #line directives generated
@ffissore ffissore merged commit 89e7a01 into arduino:master Sep 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arduino IDE compiler should generate full path for .ino file in .elf
2 participants